package de.szut.bomberman.ki.search;


public class Findblock {
	
	public boolean nearblock = false;

	public boolean getNearblock() {
		return nearblock;
	}

	public void setNearblock(boolean nearblock) {
		this.nearblock = nearblock;
	}


	
	public boolean nearblock(int [][] field, int xcore, int ycore) {
		nearblock = false;
		

		for(int n = -1; n <= 1; n = n +2){
			
			try{
				if(field[xcore + n][ycore] == 2){
					nearblock = true;
				}
			}catch (Exception e){}
		}
	
		for(int n = -1; n <= 1; n = n +2){
			
			try{
				if(field[xcore][ycore + n] == 2){
					nearblock = true;
				}
			
			}catch (Exception e){
				
			}
		}

		this.setNearblock(nearblock);
		return nearblock;
	}
}
